package com.baoxin.chenxixc4coach.fragments;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;

import com.baoxin.chenxixc4coach.LoginActivity;
import com.baoxin.chenxixc4coach.MainActivity;
import com.baoxin.chenxixc4coach.java.IActivityLifeCheck;

/**
 * 存储activity
 */
public class BaseFragment extends Fragment implements IActivityLifeCheck {
    protected Activity activity;

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        activity = (Activity) context;
    }

    @Override
    public void onDetach() {
        super.onDetach();
        activity = null;
    }

    public boolean activityAlive() {
        return activity == null ? false : true;
    }


}
